/*
 * Ext GWT - Ext for GWT
 * Copyright(c) 2007-2009, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */
package com.avidys.gwt.ext;

import com.avidys.gwt.wom.client.Messages;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.button.Button;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.extjs.gxt.ui.client.widget.layout.FlowData;
import com.google.gwt.user.client.Element;

public class DialogGames extends LayoutContainer {

  @Override
  protected void onRender(Element parent, int pos) {
    super.onRender(parent, pos);
    final Dialog simple = new Dialog();
    simple.setHeading("Dialog Test");
    simple.setButtons(Dialog.YESNO);
    simple.setBodyStyleName("pad-text");
    simple.addText(Messages.mStartGameExplanation);
    simple.setScrollMode(Scroll.AUTO);
    simple.setHideOnButtonClick(true);

    ButtonBar buttons = new ButtonBar();

    buttons.add(new Button("Simple", new SelectionListener<ButtonEvent>() {
      public void componentSelected(ButtonEvent ce) {
        simple.show();
      }
    }));

    add(buttons, new FlowData(10));
  }
}
